Optimal. Leaf size=51 \[ \frac {1}{2} e^x x^2 \sin (x)+\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x \sin (x)-\frac {1}{2} e^x \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 5, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {4433, 4466, 14, 4432, 4465} \[ \frac {1}{2} e^x x^2 \sin (x)+\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x \sin (x)-\frac {1}{2} e^x \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 4432
Rule 4433
Rule 4465
Rule 4466
Rubi steps
\begin {align*} \int e^x x^2 \cos (x) \, dx &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-2 \int x \left (\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-2 \int \left (\frac {1}{2} e^x x \cos (x)+\frac {1}{2} e^x x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-\int e^x x \cos (x) \, dx-\int e^x x \sin (x) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+\int \left (-\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx+\int \left (\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+2 \left (\frac {1}{2} \int e^x \sin (x) \, dx\right )\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+2 \left (-\frac {1}{4} e^x \cos (x)+\frac {1}{4} e^x \sin (x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 23, normalized size = 0.45 \[ \frac {1}{2} e^x (x-1) ((x-1) \sin (x)+(x+1) \cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 26, normalized size = 0.51 \[ \frac {1}{2} \, {\left (x^{2} - 1\right )} \cos \relax (x) e^{x} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} \sin \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 24, normalized size = 0.47 \[ \frac {1}{2} \, {\left ({\left (x^{2} - 1\right )} \cos \relax (x) + {\left (x^{2} - 2 \, x + 1\right )} \sin \relax (x)\right )} e^{x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.03, size = 28, normalized size = 0.55 \[ \left (\frac {x^{2}}{2}-\frac {1}{2}\right ) {\mathrm e}^{x} \cos \relax (x )-\left (-\frac {1}{2} x^{2}+x -\frac {1}{2}\right ) {\mathrm e}^{x} \sin \relax (x ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 26, normalized size = 0.51 \[ \frac {1}{2} \, {\left (x^{2} - 1\right )} \cos \relax (x) e^{x} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} \sin \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.36, size = 22, normalized size = 0.43 \[ \frac {{\mathrm {e}}^x\,\left (x-1\right )\,\left (\cos \relax (x)-\sin \relax (x)+x\,\cos \relax (x)+x\,\sin \relax (x)\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.56, size = 48, normalized size = 0.94 \[ \frac {x^{2} e^{x} \sin {\relax (x )}}{2} + \frac {x^{2} e^{x} \cos {\relax (x )}}{2} - x e^{x} \sin {\relax (x )} + \frac {e^{x} \sin {\relax (x )}}{2} - \frac {e^{x} \cos {\relax (x )}}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________